﻿@model PagedList.IPagedList<e_commerce.Models.GoodsModel>
@using PagedList.Mvc
@{
    ViewBag.Title = "AllGoods";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}

<div class="message-wrap">
    <div class="admin-nav">
        <div class="nav-text">
            <span>
                @TempData["f-nav"] > @TempData["s-nav"]
            </span>
        </div>
    </div>
    <div class="message-wrap-tab">
        <div class="box">
            <div class="box-head">
                <div class="box-title">
                    <img src="~/Image/icon_thing.png" />
                    <span>全部商品</span>
                </div>
            </div>
            <div class="box-body">
                <div class="wrap-tab">
                    <table class="layui-table" lay-skin='row'>
                        <colgroup>
                            <col width="100">
                            <col width="40">
                            <col width="80">
                            <col width="300">
                            <col width="80">
                            <col width="120">
                        </colgroup>
                        <thead>
                            <tr>
                                <th>商品名</th>
                                <th>库存</th>
                                <th>售价</th>
                                <th>备注</th>
                                <th>状态</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach (var item in Model)
                            {
                                <tr>
                                    <td>@item.Name</td>
                                    <td>@item.Stock</td>
                                    <td>￥@item.Price</td>
                                    <td>@item.Mark</td>
                                    <td>@item.StateDescribe</td>
                                    <td>
                                        <input type="hidden" value="@item.GoodsId" />
                                        <a href="javasripts:;" class="on-shelves">上架</a>
                                        <a href="javasripts:;" class="un-shelves">下架</a>
                                        <a href="javasripts:;" class="delete">删除</a>
                                        <a href="/Admin/EditGoods?@item.GoodsId" class="edit-goods">编辑</a>
                                    </td>
                                </tr>
                            }
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        
        <div class="wrap-pages">
            <span>共搜索到 @Model.TotalItemCount  条数据,已浏览数据 @((Model.PageNumber - 1) * Model.PageSize + Model.Count()) 条</span>
            @Html.PagedListPager(Model, page => Url.Action("AllGoods", new { page }))
        </div>
    </div>
</div>

@section Styles{
}

@section Scripts{
<script src="~/JS/AllGoods.js"></script>
}